#include "Circle.h"

E_Point* Circle::GetALLPoint()
{
    return P;
}

void Circle::ReadPoint()
{
    int a = 100; double m = 0.5523;
    P[0].x = 0, P[0].y = a;
    P[1].x = m*a, P[1].y = a;
    P[2].x = a, P[2].y = m*a;
    P[3].x = a, P[3].y = 0;
    P[4].x = a, P[4].y = -m*a;
    P[5].x = m*a, P[5].y = -a;
    P[6].x = 0, P[6].y = -a;
    P[7].x = -m*a, P[7].y = -a;
    P[8].x = -a, P[8].y = -m*a;
    P[9].x = -a, P[9].y = 0;
    P[10].x = -a, P[10].y = m*a;
    P[11].x = -m*a, P[11].y = a;
    P[12].x = 0, P[12].y = a;
}

void Circle::DrawControl()
{
    setlinecolor(LIGHTBLUE);
    setlinestyle(PS_SOLID, 2);
    moveto(P[0].x, P[0].y);
    for (int i = 1; i < 13; i++) {
        lineto(P[i].x, P[i].y);
    }
}

void Circle::DrawCurve()
{

    for (int i = 0; i < 12; i+=3) {
        B.Draw(P, i, i + 3);
    }
}
